package com.h0821;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Calendar {
    public static void main(String[] args) {
        Calendar cal = new Calendar();
        Date date = new Date();
        SimpleDateFormat f = new  SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String  time = f.format(date);
        String today = "2020-50-22";
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        Date t = null;
        try {
            t = format.parse(today);
            System.out.println(t);
        } catch (ParseException e) {
            e.printStackTrace();
        }

    }
}
